public class Main1 {
    public int getMost(int[][] board) {
        // write code here
        int[][] gift = new int[6][6];
        for (int i = 0; i < 6; i++) {
            for (int j = 0; j < 6; j++) {
                int x = board[i][j];
                if (i == 0 && j == 0) {
                    gift[i][j] = x;
                } else if (i == 0) {
                    gift[i][j] = gift[i][j - 1] + x;
                } else if (j == 0) {
                    gift[i][j] = gift[i - 1][j] + x;
                } else {
                    gift[i][j] = Math.max(gift[i - 1][j], gift[i][j - 1]) + x;
                }
            }
        }
        return gift[5][5];
    }

    public static void main(String[] args) {

    }
}
